package com.eshop.servlet;

import java.io.IOException;
import java.util.ArrayList;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.eshop.bean.DetailBean;
import com.eshop.userorder.dao.SelectDetailDao;

public class DetailOrder extends HttpServlet {

	
	public DetailOrder() {
		super();
	}

	public void destroy() {
		super.destroy();
	}


	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request, response);

	}


	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		Integer ordersId = Integer.valueOf(request.getParameter("ordersId"));
		SelectDetailDao selectDetailDao = new SelectDetailDao();
		ArrayList<DetailBean> selectDetail = selectDetailDao.selectDetail(ordersId);
		
		request.setAttribute("selectDetail", selectDetail);
		request.getRequestDispatcher("/PAGE/orderdetail.jsp").forward(request, response);
		
		
	}

	
	public void init() throws ServletException {
	
	}

}
